#ifndef __ARTIST_FSSERVER_H__
#define __ARTIST_FSSERVER_H__
PUBLIC VOID FSServer();


#define FSSERVER_WHOIAM                    (0)
#define FSSERVER_CREATEFILE                (1)
#define FSSERVER_CREATEDIRECTORY           (2)
#define FSSERVER_OPENFILE                  (3)
#define FSSERVER_OPENDIRECTORY             (4)
#define FSSERVER_INSERTFILECONTENT         (5)
#define FSSERVER_DELETEFILECONTENT         (6)
#define FSSERVER_DELETEDIRECTORY           (7)
#define FSSERVER_DELETEFILE                (8)
#define FSSERVER_READDIRECTORY             (9)
#define FSSERVER_CLOSEFILE                 (10)
#define FSSERVER_CLOSEDIRECTORY            (11)
#define FSSERVER_READFILE                  (12)

typedef struct struct_fileparameter
        {
            PCHAR fp_name;/*it's a pointer to a string ended with '\0'  ,not a buffer.the length is variable ,God knows it.*/
            U4B   fp_attribute;
        }FILEPARAMETER;

typedef struct struct_filedescriptor
        {
		    U4B          index;      /*In the cluster ,it's the index.*/
			U4B          pad;
			ULLONG       howmany;    /*the insert or delete read byte number.*/
			POINTER4B    pointer;    /*content pointer ,PDIRECTORYITEM and so on.*/
			PCHAR        path ;       /*the file or directory path*/

		    ULLONG       location;    /*the cluster location.*/
            ULLONG       where;       /*the offset of text.*/
		}FILEDESCRIPTOR;

typedef struct struct_filedescriptor*  PFILEDESCRIPTOR;
		
PUBLIC S4B VerifyFSValidity();
PUBLIC S4B SetupFileSystem();
PUBLIC S4B SetupFSBufferControl();
PUBLIC S4B LoadSuperCluster();
PUBLIC S4B CreateDirectory        (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B CreateFile             (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B OpenFile               (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B OpenDirectory          (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B DeleteOpenedFileContent(PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B InsertOpenedFileContent(PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B DeleteOpenedDirectory  (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B DeleteOpenedFile       (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B ReadOpenedDirectory    (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B CloseOpenedFile        (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B CloseOpenedDirectory   (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B ReadOpenedFile         (PFILEDESCRIPTOR pdescriptor);

PUBLIC S4B FSOpenFile             (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B FSReadDirectory        (PFILEDESCRIPTOR pdescriptor);
PUBLIC S4B FSReadFile             (PFILEDESCRIPTOR pdescriptor);

#endif
